<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>赛程管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/race/raceSchedule/">赛程列表</a></li>
		<li class="active">
			<a>
		  <c:if test="${raceSchedule.id == null}">新建赛程</c:if>
			<c:if test="${copy=='copy'}">复制赛程</c:if>
			<c:if test="${copy==null && raceSchedule.id != null}">编辑赛程</c:if>
			</a>


		</li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="raceSchedule" action="${ctx}/race/raceSchedule/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>

		<div class="control-group">
			<label class="control-label">赛程名称：</label>
			<div class="controls">
				<form:input path="scheduleName" htmlEscape="false" maxlength="100" class="input-xlarge required"/>
				<span class="help-inline" id="inline"><font color="red">*</font> </span>
			</div>
		</div>


		<c:if test="${copy=='copy'}">
			<input type="hidden" name="topy" value="topy">
		</c:if>


		<div class="control-group">
			<label class="control-label">赛程LOGO：</label>
			<div class="controls">
				<form:hidden id="scheduleLogo" path="scheduleLogo" htmlEscape="falses" maxlength="255" class="input-xlarge"/>
				<sys:ckfinder input="scheduleLogo" type="image" uploadPath="/photo" selectMultiple="false" maxWidth="100"
							  maxHeight="100"/>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">赛程公告：</label>
			<div class="controls">
				<form:textarea path="scheduleNotice" htmlEscape="false" rows="4" maxlength="256" class="input-xxlarge required"/>
				<span class="help-inline" id="inline"><font color="red">*</font> </span>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">竞赛题库：</label>
			<div class="controls">
				<form:select path="repertoryId" class="input-xlarge required">
					<c:forEach items="${raceRepertories}" var="raceRepertorie">
					<form:option value="${raceRepertorie.repertoryName}" label="${raceRepertorie.repertoryName}"/>
						<form:options items="${fns:getDictList('')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
					</c:forEach>
				</form:select>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">比赛开始时间：</label>
			<div class="controls">
				<input name="beginTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
					   value="<fmt:formatDate value="${raceSchedule.beginTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					   onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
				<span class="help-inline" id="inline"><font color="red">*</font> </span>
			</div>
		</div>



		<div class="control-group">
			<label class="control-label">比赛结束时间：</label>
			<div class="controls">
				<input name="endTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
					   value="<fmt:formatDate value="${raceSchedule.endTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					   onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
				<span class="help-inline" id="inline"><font color="red">*</font> </span>
			</div>
		</div>




		<div class="control-group">
			<label class="control-label">队伍排名切换时间：</label>
			<div class="controls">
				<form:select path="switchTime" class="input-xlarge " name="switch">
					<form:option value="5" label="5分钟"/>
					<form:option value="10" label="10分钟"/>
					<form:option value="20" label="20分钟"/>
					<form:option value="30" label="30分钟"/>
					<form:option value="60" label="一小时"/>
				</form:select>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">展示粒度：</label>
			<div class="controls">
				<form:select path="displaySize" class="input-xlarge ">
					<form:option value="5" label="5分钟"/>
					<form:option value="10" label="10分钟"/>
					<form:option value="20" label="20分钟"/>
					<form:option value="30" label="30分钟"/>
					<form:option value="60" label="一小时"/>
						<form:options items="${fns:getDictList('')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>


		<div class="control-group">
			<label class="control-label">加分规则：</label>
			<label class="control-label">第一名提交flag的队伍加&nbsp&nbsp&nbsp</label>
			<div class="controls">
				<form:input path="plusReluI" htmlEscape="false" maxlength="30"  cssStyle="width: 25px" />分
			</div>

			<label class="control-label">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</label>
			<label class="control-label">第二名提交flag的队伍加&nbsp&nbsp&nbsp</label>
			<div class="controls">
				<form:input path="plusReluIi" htmlEscape="false" maxlength="30"  cssStyle="width: 25px "/>分
			</div>


			<label class="control-label">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</label>
			<label class="control-label">第三名提交flag的队伍加&nbsp&nbsp&nbsp</label>
			<div class="controls">
				<form:input path="plusReluIii" htmlEscape="false" maxlength="30"  cssStyle="width: 25px"/>分
			</div>

			<label class="control-label">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</label>
			<label class="control-label">第四名提交flag的队伍加&nbsp&nbsp&nbsp</label>
			<div class="controls">
				<form:input path="plusReluIv" htmlEscape="false" maxlength="30"  cssStyle="width: 25px"/>分
			</div>

			<label class="control-label">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</label>
			<label class="control-label">第五名提交flag的队伍加&nbsp&nbsp&nbsp</label>
			<div class="controls">
				<form:input path="plusReluV" htmlEscape="false" maxlength="30"  cssStyle="width: 25px"/>分
			</div>
		</div>


		<div class="form-actions">
			<shiro:hasPermission name="race:raceSchedule:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>